package keke;

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main0503 {
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		Set<String>strSet=new TreeSet<String>();
		int n=10;
		while(in.hasNext()){
			String str=in.next();
			if(str.equals("!!!!!"))
				break;
			else if(!(strSet.contains(str)))
				strSet.add(str);
		}
		System.out.println(strSet.size());
		if(strSet.size()<=10){
			for(String e:strSet)
				System.out.println(e);
		}
		else{
			for(String e:strSet){
				if(n--<=0)
					break;
				System.out.println(e);
			}	
		}
	}
}

